function value = func_MSE(predictor,response,h)

    response_hat = NaN(size(response));
    for i = 1:size(response,1)

        indicate = (1:size(response,1))' ~= i;

        num    = mean(indicate.*response.*normpdf((predictor-predictor(i))/h));
        denom  = mean(indicate.*normpdf((predictor-predictor(i))/h)); 

        response_hat(i) = num/max(denom,eps);

    end    

    pre_q90 = quantile(predictor,.9);
    pre_q10 = quantile(predictor,.1);
    
    weight = (predictor>=pre_q10) & (predictor<=pre_q90);

    value = mean(weight.*(response-response_hat).^2);

end